import operate from '@dfeidao/atom-nodejs/db/operate';
interface Message {
	_id: string;
	connector: string;
	parent_group_id: string;
	productid: string;

}
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const systemid = '12';
	const { exec, update } = operate(action_id, session_id, systemid);
	update('allot_conditions_group', { _id: msg._id, productid: msg.productid }, { connector: msg.connector, parent_group_id: msg.parent_group_id });
	const res = await exec();
	if (res.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}

}

